<!DOCTYPE html>
<html>
  <head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/fhir-js-client@1.0.0/dist/fhir-client.min.js"></script>
    <script>

    var launchUri = window.location.protocol + "//" + window.location.host + window.location.pathname;
    var redirectUri = launchUri.replace("launch.html","index.html");
    $.getJSON( '/config', function (appConfig) {
        FHIR.oauth2.authorize({
            "client_id": appConfig.ClientId,
            "scope"    : "openid profile",
            "redirect_uri": redirectUri
            });
    });
    </script>
  </head>
  <body>Loading...</body>
</html>